{* 
//////
//    @version [ Masterton ]
//    @package hwdVideoShare
//    @copyright (C) 2007 - 2009 Highwood Design
//    @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
//////
//    hwdVideoShare Template System:::This template system uses the Smarty Template Engine. 
//    For full documentation, including syntax usage please refer to http://www.smarty.net 
//    or our website at http://www.hwdmediashare.co.uk   
//////
//    This file generates the display when a user views a category. It lists all the videos in that category
//    and if any subcategories exist it can also display these
//////
//    VARIABLES AVAILBLE IN THIS TEMPLATE FILE:                                        
//    -- $print_videolist...Only set if any video exist in the category
//    -- $print_subcats.....Only set if any subcategories exist in the category                            
//    -- $link_home.........Your website URL (to your Joomla root)                   
//////
*}

{include file='header.tpl'}

{if $print_orderselect}
	<div style="float:right;text-align:right;padding:5px;">
		{literal}
		<script language="javaScript">
		function goto_sort(form) { 
			var index=form.select_order.selectedIndex
			if (form.select_order.options[index].value != "0") {
				location=form.select_order.options[index].value;
			}
		}
		</script>
		{/literal}

		<form name="redirect">
			<select name="select_order" onchange="goto_sort(this.form)" size="1">
				<option value="" selected="selected">{$smarty.const._HWDVIDS_TITLE_ORDERING}</option>
				<option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=orderASC">{$smarty.const._HWDVIDS_SELECT_ORDERING} ASC</option>
				<option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=orderDESC">{$smarty.const._HWDVIDS_SELECT_ORDERING} DESC</option>
				<option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=dateASC">{$smarty.const._HWDVIDS_SELECT_UPLDDATE} ASC</option>
				<option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=dateDESC">{$smarty.const._HWDVIDS_SELECT_UPLDDATE} DESC</option>
				<option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=nameASC">{$smarty.const._HWDVIDS_SELECT_NAME} ASC</option>
				<option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=nameDESC">{$smarty.const._HWDVIDS_SELECT_NAME} DESC</option>
				<option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=hitsASC">{$smarty.const._HWDVIDS_SELECT_HITS} ASC</option>
				<option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=hitsDESC">{$smarty.const._HWDVIDS_SELECT_HITS} DESC</option>
				<option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=voteASC">{$smarty.const._HWDVIDS_SELECT_RATING} ASC</option>
				<option value="{$mosConfig_live_site}/index.php?option=com_hwdvideoshare&Itemid={$Itemid}&task=viewcategory&cat_id={$category_id}&order=voteDESC">{$smarty.const._HWDVIDS_SELECT_RATING} DESC</option>
			</select>
		</form>
	</div>
{/if}
<div style="clear:both;"></div>

{if $print_subcats and $print_videolist}

	<div class="sic-container">
		<div id="sic-left" class="sic-left">

{/if}
{if $print_subcats}

			<div class="hwdmodule-h5">
				<h2>Subcategories</h2>
				<div class="list">
					<div class="box">
						{foreach name=outer item=data from=$subcatlist}
													
							{if $print_videolist ne 1}<div class="categoryBox"><div class="padding">{/if}
								{include file='category_list.tpl'}
							{if $print_videolist ne 1}</div></div>{/if}
							
							{if $print_videolist ne 1}
								{if $smarty.foreach.outer.index % $cpr-($cpr-1) == 0}
								<div style="clear:both;"></div>
								{/if}
							{/if}							
							
						{/foreach}
						<div style="clear:both;"></div>
					</div>
				</div> 
			</div>

{/if}
{if $print_subcats and $print_videolist}
		
		</div>
		<div class="sic-center">
		
{/if}
{if $print_videolist}

			<div class="hwdmodule-h2">
				<h2>Videos</h2>
				<div class="list">
					{if $print_videolist}
					<div class="box">
						{foreach name=outer item=data from=$list}
							<div class="videoBox">
								{include file="video_list_simple.tpl"}
							</div>
							{if $smarty.foreach.outer.last}
								<div style="clear:both;"></div>
							{elseif $smarty.foreach.outer.index % $vpr-($vpr-1) == 0}
								<div style="clear:both;"></div></div><div class="box">
							{/if}
						{/foreach}
					</div>
					{$pageNavigation}
					{else}
						<div class="standard"><div class="padding">{$smarty.const._HWDVIDS_INFO_NUV}</div></div>
					{/if}
				</div> 
			</div>

{/if}
{if $print_subcats and $print_videolist}
		
		</div>
	</div>

{/if}

{if $print_subcats ne 1 and $print_videolist ne 1}
	<div class="hwdmodule-h2">
		<h2>Videos</h2>
		<div class="standard"><div class="padding">{$smarty.const._HWDVIDS_INFO_NCV}</div></div>
	</div>
{/if}

<div style="clear:both;"></div>

{if $print_subcats and $print_videolist}
	
	{literal}
	<script language='javascript' type='text/javascript'>
		var fullWidth = document.getElementById("hwdvids").offsetWidth;
		var sideWidth = fullWidth - {/literal}{$flvplay_width}{literal};
		document.getElementById("sic-left").style.width = sideWidth + "px";
	</script>
	{/literal}
	
{/if}

{include file='footer.tpl'}
